<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/scrollbar.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/layer.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>

    <title>限时抢购</title>
    <style>
        #img {
            float: left;
            margin-top: 12px;
            margin-right: 3px;
        }

        .spsx {
            position: fixed;
            width: 94%;
            padding: 0 3%;
            background: white;
            bottom: 0;
            z-index: 102;
            display: none;
        }

        .spsx .sp {
            border-bottom: 1px solid #F5F5F5;
            height: 70px;
            padding-bottom: 2%;
        }

        .spsx .sp img {
            float: left;
            width: 28%;
            margin-top: -5%;
            border: 2px solid white;
        }

        .spsx .sp > div {
            float: left;
            width: 65%;
            margin-left: 2%;
        }

        .spsx .sp > div h4 {
            width: 80%;
            padding: 2% 0;
            font-size: 14px;
            line-height: 1.5;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .spsx .sp > div h4 a {
            color: #212121;
        }

        .spsx .sp > div p {
            font-size: 14px;
            color: #999999;
        }

        .spsx .sp > div p span {
            color: #E73F09;
            float: right;
        }

        .wrap-det .board {
            width: 100%;
            height: 0px;
            background-color: rgba(0, 0, 0, 0.4);
            position: absolute;
            top: 0px;
            left: 0px;
            z-index: 101;
        }

        .spsx .size {
            border-bottom: 1px solid #F5F5F5;
        }

        .spsx .size h4 {
            font-size: 14px;
            line-height: 3;
        }

        .spsx .size ul {
            overflow: hidden;
        }

        .spsx .size ul li {
            float: left;
            width: 23%;
            text-align: center;
            background: #F6F6F6;
            margin-bottom: 2%;
            font-size: 14px;
            line-height: 2;
            border-radius: 6px;
        }

        .spsx .size ul li:not(.first) {
            margin-left: 2.5%;
        }

        .spsx .size ul li a {
            color: #212121;
        }

        .spsx .size ul .cur {
            background: #E73F09;
        }

        .spsx .size ul .cur a {
            color: white;
        }

        .spsx .num {
            border-bottom: 1px solid #F5F5F5;
            overflow: hidden;
            padding: 2% 0;
        }

        .spsx .num span {
            display: block;
            float: left;
        }

        .spsx .num ul {
            float: right;
            overflow: hidden;
            border: 1px solid #B3B3B3;
            border-radius: 4px;
            width: 30%;
        }

        .spsx .num ul li {
            float: left;
            font-size: 14px;
            line-height: 24px;
            width: 32%;
            text-align: center;
        }

        .spsx .num ul li:nth-of-type(2) {
            border-left: 1px solid #B3B3B3;
            border-right: 1px solid #B3B3B3;
        }

        .spsx .footer1 {
            padding: 2% 0;
        }

        .spsx .footer1 .list2 {
            float: left;
            width: 100%;
            overflow: hidden;
            margin-left: 1%;
            padding: 2% 0;
        }

        .spsx .footer1 .list2 li {
            float: left;
            width: 46%;
            margin-left: 2.5%;
            text-align: center;
            font-size: 14px;
            line-height: 2.5;
            border-radius: 4px;
        }

        .spsx .footer1 .list2 li:nth-of-type(1) {
            border: 1px solid #E73F09;
        }

        .spsx .footer1 .list2 li:nth-of-type(1) a {
            color: #E73F09;
        }

        .spsx .footer1 .list2 li:nth-of-type(2) a {
            color: white;
        }

        .spsx .footer1 .list2 li:nth-of-type(2) {
            background: #E73F09;
            border: 1px solid white;
        }

        .spsx .cancel {
            position: absolute;
            right: 3%;
            top: -5%;
        }

        .board {
            width: 100%;
            height: 0px;
            background-color: rgba(0, 0, 0, 0.4);
            position: absolute;
            top: 0px;
            left: 0px;
            z-index: 101;
        }
    </style>
</head>
{include file='public_href'}
<body>
<div class="wrap-sale">
    <div class="header">
        <p>限时抢购</p>
        <img src="__STATIC__/img/back.png" class="back" onclick=window.location.href="{:url('mobile/Index/index')}">
    </div>
    <div class="center">
        <p>距离本场结束</p>
        <input type="hidden" value="{$end_time}" id="end_time">
        <div>
            <img src="__STATIC__/img/sy-daojishi.png" id="img">
            <ul id="LeftTime"></ul>
        </div>

    </div>
    <div id="wrapper" style="top: 16%;">
        <div id="scroller">
            <div id="pullDown" style="padding-left: 35%">
                <span class="pullDownIcon"></span><span class="pullDownLabel">下拉刷新...</span>
            </div>
            {volist name="data" id="item"}
            <div class="content">
                <img src="/{$item['shop_goods']['picUrl']}">
                <div class="right">
                    <h4><a href="#">{$item['shop_goods']['title']}</a></h4>
                    {lt name="end_time" value=":date('Y-m-d H:i:s',time())"}
                    <p><span class="price">￥{$item.price}</span>></p>
                    <ul class="sale"><li><a href="#">已抢{$item.purchase_number}/{$item.number}件</a></li><li><a href="#">马上抢</a></li></ul>
                    {else/}
                    <p><span class="price">￥{$item['shop_goods']['price']}</span></p>
                    <ul class="sale-out"></li><li><a href="javascript:return false;">抢购已结束</a></li></ul>
                    {/lt}
                </div>
            </div>
            {/volist}
            <div id="pullUp" style="padding-right: 35%;float: right;{lt name=':count($data)' value='$page'}display: none{/lt}">
                <span class="pullUpIcon"></span><span class="pullUpLabel">上拉加载更多...</span>
            </div>
        </div>
    </div>
</div>
{include file='public_src'}
<script type="text/javascript" src="__STATIC__/js/public.js"></script>
<script type="application/javascript" src="__STATIC__/js/iscroll.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<script type="text/javascript" src="__STATIC__/js/iscroll_dis.js?url={:url('limited/index')}&path=__STATIC__&type=limited"></script>
<script>
    //限时抢购跳转到商品详情
    function jump_goods_details_limit(id) {
        sessionStorage.setItem('goods_url_back', window.location.href);
        window.location.href = "{:url('mobile/user_category/goods_details')}?goods_id=" + id + "&limit_status";
    }
    //倒计时效果js代码
    function checktime(i) {
        if (i < 10) {
            i = "0" + i;

        }
        else {
            i = i;
        }
        return i;
    }
    function freshTime() {
        var endtime = new Date($('#end_time').val());
        var nowtime = new Date();
        var lefttime = parseInt(endtime.getTime() - nowtime.getTime());//这是毫秒，如果再/1000就是秒
        // 获取剩下的日、小时、分钟、秒钟
        // 一天有多少毫秒，一小时有多少毫秒，一分钟有多少毫秒，一秒钟有多少毫秒
        var dm = 24 * 60 * 60 * 1000;
        var d = parseInt(lefttime / dm);
        var hm = 60 * 60 * 1000;
        var h = parseInt((lefttime / hm) % 24);
        var mm = 60 * 1000;
        var m = parseInt((lefttime / mm) % 60);
        var s = parseInt((lefttime / 1000) % 60);
        m = checktime(m);
        s = checktime(s);
        document.getElementById('LeftTime').innerHTML = "<li class='time'>&#8197;" + d + "&#8197;</li><li>&#8197;天&#8197;</li><li class='time'>&#8197;" + h + "&#8197;</li><li>&#8197;小时&#8197;</li><li class='time'>&#8197;" + m + "&#8197;</li><li>&#8197;分钟&#8197;</li><li class='time'>&#8197;" + s + "&#8197;</li><li>&#8197;秒&#8197;</li>";
        if (lefttime < 0) {
            document.getElementById('LeftTime').innerHTML = "团购活动已经结束！";
        }
    }
    freshTime();
    var sh;
    sh = setInterval('freshTime()', 1000)

</script>
</body>
</html>